package com.web.farme.component;

import com.web.farme.meta.ColumnMetadata;
import com.web.farme.meta.TableFieldInfo;
import com.web.farme.meta.TableInfo;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;

public interface DatabaseHandler {

    void createTable(Connection connection, TableInfo tableInfo) throws SQLException;

    boolean tableIsExist(Connection connection, String tableName) throws SQLException;

    Map<String, ColumnMetadata> getColumnMetaData(Connection connection, String tableName) throws SQLException;

    void handleIndex(Connection connection, TableInfo tableInfo) throws SQLException;

    void addColumn(Connection connection, TableFieldInfo tableFieldInfo, String tableName) throws SQLException;

    void modifyColumn(Connection connection, ColumnMetadata columnMetadata, TableFieldInfo tableFieldInfo, String tableName) throws SQLException;


}
